The present invention relates to an optical device, such as an automatic focusing camera and a monitor camera, having an automatic focusing function.
Various techniques for measuring distances to objects which are in different directions using an optical device are known. One of these techniques is disclosed in the Japanese Patent Publication No. 4-67607. Further, a plurality of techniques for estimating an area, in the object space, which includes a main object on the basis of distance distribution information of the objects obtained by using the techniques for measuring distances to the objects are disclosed.
Below, a typical conventional method of estimating an area which includes a main object is explained with reference to FIGS. 15A to 15C.
First, a scene, such as the one shown in FIG. 15A, is sensed by using a pair of image sensing devices, such as CCDs, arranged inside of an optical device, such as a camera, at a predetermined distance from each other. Two images, sensed by the pair of image sensing devices, which have parallax are respectively divided into M×n blocks. Then, by performing known correlation operation between signals of a given block of one of the two images and signals of the corresponding block of the other image, it is possible to obtain the distance to an object and/or a defocused amount of the block based on trigonometry principle. The correlation operation is performed on every block, and distance distribution information of M×n blocks as shown in FIG. 15B is obtained. The numerals in FIG. 15B denote distance values or defocused values. The blank blocks are where it is determined that reliability of the result of correlation operation performed on these blocks is low due to low contrast of image signals, for instance.
Next, grouping of blocks is performed in order to separate objects, in the object space, on the sensed images. After grouping, the M×n blocks are combined into areas each includes each object as shown in FIG. 15C. Note that the hatched portions in FIG. 15C correspond to the blank blocks in FIG. 15B and are determined that reliability of the result of correlation operation in these areas is low due to low contrast of image signals, for instance.
As for a method of grouping, there is a method of determining similarity of adjoining blocks by, e.g., comparing the values of the adjoining blocks shown in FIG. 15B, and determining that the adjoining blocks are composed of the same object if the similarity is high, whereas, determining that they are composed of different objects if the similarity is low. Note, when the images are divided into relatively large blocks, as shown in FIG. 15B, the distance distribution information to be used for the grouping is simple values, such as distance values or defocused values; however, in a case where the block is very small, fine distance distribution information can be obtained, the information is often vectors normal to surfaces.
For example, a distance value of a given block as shown in FIG. 15B is compared to respective distance values of its adjoining blocks, and if the difference between the distance values of the adjoining two blocks is within a predetermined threshold, then it is determined that “the objects in the blocks compose the same object”. Whereas, if the distance is greater than the threshold, then it is determined that “the object in the blocks compose different objects.” By performing the aforesaid determination on every block, blocks are grouped into common objects. The grouped blocks which compose each object are dealt with as a group.
Thereafter, characteristics of each group in the image are evaluated, and the group which includes the main object is determined out of all the groups.
In a case of the groups as shown in FIG. 15C, characteristics, such as average distances to the objects, widths, heights, and positions of the groups in the frame, are obtained for all the groups GR1 to GR7, and evaluated as a whole, thereby determining the group which is considered to include the main object. For example, likelihood (possibility) of the group having the main object is obtained using a predetermined function, such as the following equation 1, then the obtained values are evaluated.(possibility)=W1×(width)×(height)+W2/(distance from the center of frame)+W3/(average distance)  (1)
In the equation 1, W1, W2, and W3 are constants for weighting items, “distance from the center of frame” is the distance between the center of the frame and the center of mass of the group, and “average distance” is an average of distances to the object from the camera in all the blocks of each group. The probability is calculated for every group, and the group having the largest probability is determined as including the main object.
Thereafter, a focal length is determined on the basis of the distance information of the group, determined as including the main object, so as to focus on an object in the group, then the lens is actually moved to focus on the object.
In the conventional focusing function as described above, an area including the main object is automatically determined on the basis of the aforesaid information, for instance, and focus control is performed on the basis of the determined result.
However, there are a variety of scenes to be sensed and a variety of objects to be the main object; therefore, the main object which the user actually intends to focus on is not always correctly determined as the main object in the aforesaid method.
Furthermore, an increase in the distance measuring points and areas caused by an increase in the number pixels of the CCDs complicates the determination of main object, which increases difficulty to focus on the main object completely automatically. However, since full-manual-selection of, selecting the main object also complicates operation of a camera, it is desirable to realize unification of automatic control and manual control to a high degree.